<template>
  <view @click="clickpay()">
    支付测试
  </view>
</template>

<script>



export default {
  data () {
    return {

    }
  },
  mounted () {
    // 将tt方法绑定到window下面，提供给外部调用
    window['paysuccess'] = () => {
      this.paysuccess()
    }
  },
  onLoad () {

  },
  methods: {
    clickpay () {
      let callback = encodeURIComponent('paysuccess()');
      /*#ifdef H5*/
      window.SMTJSApi && SMTJSApi.postMessage(`pay?orderNo=1725420426274394112&callback=${callback}`);
      /*#endif*/
    },
    paysuccess (orderNo) {
      uni.redirectTo({
        url: '/pages/paySuccess/paySuccess?orderNo=${orderNo}',
        success: res => { },
        fail: () => { },
        complete: () => { }
      });
    }
  }
}
</script>

<style>
</style>
